package com.mitasoft.library;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;

public class SearchBookActivity extends Activity {

	public static final String KEY_TITLE = "title";
	
	private Button btnSearch;
	private EditText tbTitle;
	
	private OnClickListener OnSearchClicked = new OnClickListener() {
		public void onClick(View v) {
			Intent searchResult = new Intent(SearchBookActivity.this, SearchResultActivity.class);
			
			searchResult.putExtra(KEY_TITLE, tbTitle.getText().toString());
			
			startActivity(searchResult);
		}
	};

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.search_book);

		tbTitle = (EditText) findViewById(R.id.editTextTitle);
		
		btnSearch = (Button) findViewById(R.id.buttonSearch);
		btnSearch.setOnClickListener(OnSearchClicked);
	}
}
